const obj = {
    lift: ['吃饭', '睡觉','打豆豆'],
    learn: ['语文', '数学', '外语'],
    work: ['喝茶'],
    each: function(callback) {
        const all = [].concat(this.lift, this.learn, this.work);
        for(const item of all) {
            callback(item);
        }
    },
    [Symbol.iterator]: function() {
        const all = [...this.lift, ...this.learn, this.work];
        let index = 0;
        return {
            next: function() {
                return {
                    value: all[index],
                    done: index++ > all.length
                }
            } 
        }
    }
}

for(const item of obj.lift) {
    console.log(item);
}

// obj.each(function(item) {
//     console.log(item)
// })

// obj.each(item => console.log(item)); 

